package com.campus.manage.service.impl;

import java.util.List;
import com.campus.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.campus.manage.mapper.LostMapper;
import com.campus.manage.domain.Lost;
import com.campus.manage.service.ILostService;

/**
 * 失物招领Service业务层处理
 * 
 * @author hehe
 * @date 2025-10-22
 */
@Service
public class LostServiceImpl implements ILostService 
{
    @Autowired
    private LostMapper lostMapper;

    /**
     * 查询失物招领
     * 
     * @param lostId 失物招领主键
     * @return 失物招领
     */
    @Override
    public Lost selectLostByLostId(Long lostId)
    {
        return lostMapper.selectLostByLostId(lostId);
    }

    /**
     * 查询失物招领列表
     * 
     * @param lost 失物招领
     * @return 失物招领
     */
    @Override
    public List<Lost> selectLostList(Lost lost)
    {
        return lostMapper.selectLostList(lost);
    }

    /**
     * 新增失物招领
     * 
     * @param lost 失物招领
     * @return 结果
     */
    @Override
    public int insertLost(Lost lost)
    {
        lost.setCreateTime(DateUtils.getNowDate());
        return lostMapper.insertLost(lost);
    }

    /**
     * 修改失物招领
     * 
     * @param lost 失物招领
     * @return 结果
     */
    @Override
    public int updateLost(Lost lost)
    {
        lost.setUpdateTime(DateUtils.getNowDate());
        return lostMapper.updateLost(lost);
    }

    /**
     * 批量删除失物招领
     * 
     * @param lostIds 需要删除的失物招领主键
     * @return 结果
     */
    @Override
    public int deleteLostByLostIds(Long[] lostIds)
    {
        return lostMapper.deleteLostByLostIds(lostIds);
    }

    /**
     * 删除失物招领信息
     * 
     * @param lostId 失物招领主键
     * @return 结果
     */
    @Override
    public int deleteLostByLostId(Long lostId)
    {
        return lostMapper.deleteLostByLostId(lostId);
    }
}
